Page({
  data: {
    classes: [],
    textClass: '',
    user: {}
  },
  onShow:function(){
    wx.showToast({
      title: '加载中...',
      icon: 'loading',
      duration: 10000
    })
    let _user = wx.getStorageSync('user');
    this.setData({
      user: _user,
      time: new Date(_user.createtime).toLocaleDateString()
    })
    let _this = this
    console.log(_user.id)
    wx.request({
      url: `https://www.azhouaa.cn/wxs/User/selStudy?userid=${_user.id}`,
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res)
        if (res.data.code == 200) {
          _this.setData({
            classes: res.data.msg,
          })

        }
      },
      complete: function () {
        wx.hideToast()
      }
    })
  },
  onLoad: function () {
    
  },
})